package com.thoughtworks.recruit.test.jgraph.graph.builder;

import com.thoughtworks.recruit.test.jgraph.interfaces.DiGraph;

/**
 * A builder class for directed weighted graphs}. If you want to extend this class, see
 * {@link DiWeightedGraphBuilderBase}.
 * 
 * @param <V> the graph vertex type
 * @param <E> the graph edge type
 * @param <G> type of the resulting graph
 * 
 */
public final class DiWeightedGraphBuilder<V, E,
    G extends DiGraph<V, E> & DiGraph.WeightedGraph<V, E>>
    extends DiWeightedGraphBuilderBase<V, E, G, DiWeightedGraphBuilder<V, E, G>>
{
    /**
     * Creates a builder based on {@code baseGraph}. {@code baseGraph} must be mutable.
     *
     * <p>
     * The recommended way to use this constructor is: {@code new
     * DiWeightedGraphBuilder<...>(new YourGraph<...>(...))}.
     *
     * <p>
     * NOTE: {@code baseGraph} should not be an existing graph. If you want to add an existing graph
     * to the graph being built, you should use the {@link #addVertex(Object)} method.
     *
     * @param baseGraph the graph object to base building on
     */
    public DiWeightedGraphBuilder(G baseGraph)
    {
        super(baseGraph);
    }

    /**
     * {@inheritDoc}
     */
    @Override
    protected DiWeightedGraphBuilder<V, E, G> self()
    {
        return this;
    }
}
